package com.tjbklx1.thread.chap02.practise05.ext1;

public class Line {
	private final Point startPoint; 
	private final Point endPoint; 

	public Line(Point startPoint, Point endPoint) {
		this.startPoint = startPoint;
		this.endPoint = endPoint;
	}

	public Line(int startX, int startY, int endX, int endY) {
		this.startPoint = new Point(startX, endX);
		this.endPoint = new Point(startY, endY);
	}

	public int getStartX() {
		return this.startPoint.x;
	}

	public int getStartY() {
		return this.startPoint.y;
	}

	public int getEndX() {
		return this.endPoint.x;
	}

	public int getEndY() {
		return this.endPoint.y;
	}

	@Override
	public String toString() {
		return "[ Line:" + startPoint + "-" + endPoint + "]";
	}

}
